from http.server import HTTPServer, BaseHTTPRequestHandler


class SimpleHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200)
        self.send_header("Content-Type", "text/html")
        self.end_headers()
        path = self.path
        html_content = f"""
        <!DOCTYPE html>
            <html lang="en">
            <head>
                <meta charset="UTF-8">
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                <title>Document</title>
            </head>
            <body>
                    <p>你请求的路径为{path}</p>
            </body>
            </html>
        """
        self.wfile.write(html_content.encode("utf-8"))

    def do_POST(self):
        pass


server_address = ("", 8000)
httpServer = HTTPServer(server_address, SimpleHandler)
httpServer.serve_forever()
